#pragma once
#include <fstream>
#include <algorithm>
#include <iomanip>
#include <string>
#include "my_container.h"

class big_int
{
private:
   my_container digits;
   bool negative_sign;
   int shift;
   static const int base = 1000000000;
   static const int base_lenght = 9;

private:
   void cut_zeros();
   int find_quot (const big_int&);
   int abs_compare(const big_int&) const;
   std :: pair <big_int, big_int> divide(const big_int&) const;

public:
   big_int();
   big_int(int);
   explicit big_int(std::string);
   size_t size() const;
   void swap(big_int&);
   int compare(const big_int&) const;
        
   bool operator >(const big_int&) const;
   bool operator <(const big_int&) const;
   bool operator >=(const big_int&) const;
   bool operator <=(const big_int&) const;
   bool operator ==(const big_int&) const;
   bool operator !=(const big_int&) const;

   big_int& operator = (const big_int&);
   big_int& operator+=(const big_int&);
   big_int& operator-=(const big_int&);
   big_int& operator*=(const big_int&);
   big_int& operator/=(const big_int&);
   big_int& operator%=(const big_int&);
   big_int& operator<<=(size_t);
   big_int& operator>>=(size_t);

   big_int operator -() const;
   big_int operator +(const big_int&) const;
   big_int operator -(const big_int&) const;
   big_int operator *(const big_int&) const;
   big_int operator /(const big_int&) const;
   big_int operator %(const big_int&) const;
public:
   friend std :: istream& operator >>(std :: istream&, big_int&);
   friend std :: ostream& operator <<(std :: ostream&, const big_int&);
};

big_int abs(big_int);
   big_int operator<<(const big_int&, size_t);
   big_int operator>>(const big_int&, size_t);
